package com.api.gbhg.liuwenbo.commons.utils;

import weaver.conn.RecordSet;

/**
 * @Description
 * @Author
 * @Date
 */
public class Util {

    /**
     * 获取单位名称
     * @param id
     *          单位id
     * @return
     */
    public static String getCompanyName(String id){
        RecordSet rs = new RecordSet();
        String sql = "select subcompanyname from hrmsubcompany where id = "+id+"";

        rs.executeQuery(sql);
        if (rs.next()){
            return rs.getString("subcompanyname");
        }else{
            return "";
        }

    }

    public static String getRequestInfo(String lcid,String field){
        RecordSet rs = new RecordSet();
        String sql = "select "+field+" from workflow_requestbase where requestid="+lcid;
        rs.executeQuery(sql);
        if (rs.next()){
            return rs.getString(field);
        }else{
            return "";
        }

    }
}
